import request from '../utils/request';

export const fetchData = query => {
    return request({
        url: './table.json',
        method: 'get',
        params: query
    });
};

export default {
    getAllUser(){
       return request({
           url: 'usermanager/sys-user/user',
           method:'get'
       })
    },
    userLogin(params){
        return request({
            url: 'usermanager/sys-user/login',
            method:'post',
            params
        })
    },
    getUserList() {
        return request({
            url: 'usermanager/sys-user/user',
            method:'get'
        })
    },
    deleteUser(param){
        return request({
            url: 'usermanager/sys-user/user',
            method:'delete',
            params:{
                userId:param
            }
        })
    },
    updateUser(params){
        return request({
            url: 'usermanager/sys-user/user',
            method:'post',
            params
        })
    },
    insertUser(params){
        return request({
            url: 'usermanager/sys-user/user',
            method:'put',
            params
        })
    }

};
